const axios = require('axios');

async function testLogin() {
  try {
    console.log('尝试登录...');
    const response = await axios.post('http://localhost:3000/api/auth/login', {
      username: 'admin',
      password: '123456'
    });
    
    console.log('登录API完整响应:');
    console.log(JSON.stringify(response.data, null, 2));
  } catch (error) {
    console.error('登录失败:', error.message);
    if (error.response) {
      console.error('错误响应:', error.response.data);
    }
  }
}

testLogin(); 